home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.JList;
- import java.awt.event.MouseAdapter;
- import java.awt.event.MouseEvent;
- import java.io.File;
-
- class BasicFileChooserUI$DoubleClickListener extends MouseAdapter {
- // $FF: synthetic field
- BasicFileChooserUI this$0;
- JList list;
-
- // $FF: synthetic method
- public BasicFileChooserUI$DoubleClickListener(BasicFileChooserUI this$0, JList list) {
- this.this$0 = this$0;
- this.list = list;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getClickCount() == 2) {
- int index = this.list.locationToIndex(e.getPoint());
- if (index >= 0) {
- File f = (File)this.list.getModel().getElementAt(index);
- if (this.this$0.getFileChooser().isTraversable(f)) {
- this.list.clearSelection();
- this.this$0.getFileChooser().setCurrentDirectory(f);
- } else {
- this.this$0.getFileChooser().approveSelection();
- }
- }
- }
-
- }
- }
-